<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>正中云平台登录</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>

    <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css" media="all">
    <!--公用样式-->
    <link rel="stylesheet" href="${re.contextPath}/plugin/common/css/comment.css">
    <!--页面样式-->
    <link rel="stylesheet" href="${re.contextPath}/plugin/common/css/style.css">
    <link rel="stylesheet" href="${re.contextPath}/plugin/common/css/extended.css">
    <script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.js"></script>
    <script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
</head>
<body>

<!--头部-->
<header class="whitebg">
    <div><a href="/index"><img src="${re.contextPath}/plugin/common/images/2@2xnewlogo.png"  style="width: 290px" class="logo" alt=""/></a> </div>
</header>
<!--容器-->
<div class="container">
    <!--占位-->
    <div class="headerHight"></div>
    <div class="bgImg">
        <div class="login clearfix">
            <div class="loginLeft fl bluebg center">
                <img src="${re.contextPath}/plugin/common/images/1@2xnew.png" style="width: 290px" alt="">
                <div class="white ft20 mt50">欢迎使用信息技术咨询和<br/>管理科技服务云平台</div>
            </div>
            <div class="loginRight fr whitebg">
                <ul class="ft26 bold clearfix">
                    <li class="fl <#if ((type=="")||(type=="login"))>focus</#if> ">登录</li>
                    <li class="fr <#if type=="register">focus</#if> ">注册</li>
                </ul>
                <div class="tabBox">
                    <!--登录-->
                    <div class="loginMain <#if ((type!="login"))>hide</#if>">
                        <form method="post" action="${re.contextPath}/login" class="layui-form">
                            <#--                        <form action="${re.contextPath}/login" method="post" class="layui-form">-->
                            <span class="gary">用户名</span>
                            <div>
                                <input type="text" name="username" id="username" lay-verify="username" value=""
                                       placeholder="请输入用户名"/>
                            </div>
                            <span class="gary">密码</span>
                            <div>
                                <input type="password" name="password" id="password" lay-verify="password" value=""
                                       placeholder="请输入密码"/>
                            </div>
                            <span class="gary">验证码</span>
                            <nav>
                                <input type="text" name="code" id="yzm-input" value="" lay-verify="code" placeholder="请输入验证码"/>
                                <img id="code" src="" alt=""/>
                            </nav>
                            <div class="codePassword gary clearfix">
                                <input type="checkbox" name="rememberMe" id="rememUsername" title="记住账号" lay-skin="primary"
                                       class="fl mt10">
                                <span class="fr">
                                    <a onclick="forget()" class="gary" style="margin-top: 0px;cursor: pointer;">忘记密码</a></span>
                            </div>
                            <div>
                                <#--<input value="登录" lay-submit lay-filter="login" class="white bluebg"  type="submit">-->
                                <button type="submit" lay-submit lay-filter="login" class="white bluebg">登录</button>
                            </div>
                            <!---输错10次锁定-->
                            <!-- <div class="white">
                                <button type="button" class="white garybbg">登录</button>
                            </div>
                            <div class="codePassword red">
                                密码尝试次数过多，用户被锁定，联系管理员解锁联系人：王小明   联系电话：85621460
                            </div> -->
<#--                            <div class="codePassword agreeLogin center">-->
<#--                                <input type="checkbox" name="" id="chkagree" lay-verify="check" value="" title="同意"-->
<#--                                       class="fl mt10"-->
<#--                                       lay-skin="primary" checked/>-->
<#--                                <span>-->
<#--                                    <span>-->
<#--                                        <a href="#" onclick="xy()" class="blue">《注册协议》</a>-->
<#--                                    </span>-->
<#--                                    和-->
<#--                                    <span>-->
<#--                                        <a href="#" onclick="ys()" class="blue">《隐私政策》</a>-->
<#--                                    </span>-->
<#--                                </span>-->
<#--                            </div>-->
                        </form>

                    </div>
                    <!--注册-->
                    <div class="regMain mt30 <#if (type!="register")>hide</#if>">
                        <div class="gary">选择供需方：</div>
                        <div>
                            <ul id="cl_gxbox" class="clearfix mt10">
                                <li class="fl focus" lay-ay="001">我是供方</li>
                                <li class="fl ml20" lay-ay="002">我是需方</li>
                            </ul>
                        </div>
                        <div class="gary mt10">个人或组织：</div>
                        <div>
                            <ul id="cl_gzbox" class="clearfix mt10">
                                <li class="fl focus" lay-ay="001">个人</li>
                                <li class="fl ml20" lay-ay="002">组织</li>
                            </ul>
                        </div>
                        <div class="gary mt10">选择业务类型：</div>
                        <div id="cl_lxbox" class="clearfix" cl_lxbox>
                            <span class="fl"><input type="checkbox" name="name" id="" value="001" title="监理">监理</span>
                            <span class="fl"><input type="checkbox" name="name" id="" value="002" title="咨询">咨询</span>
                            <span class="fl"><input type="checkbox" name="name" id="" value="003" title="检测">检测</span>
                            <span class="fl"><input type="checkbox" name="name" id="" value="100" title="其他">其他</span>
                        </div>
                        <div>
                            <a>
                                <button class="bluebg white" onclick="toRegister()">去注册</button>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="footer">
        技术支持:山东正中信息技术股份有限公司
    </div>

</div>
<!--公用样式JS-->
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
<script>
    $(function () {
        var arr=document.cookie.split(',');
        if(arr!=null&&arr!=''&&arr[0]!=null&&arr[1]!=null){
            $("#username").val(arr[0]);
            $("#password").val(arr[1]);
            document.cookie=null;
        }

        layui.use(['form', 'layer'], function () {
            var form = layui.form;
            var layer = layui.layer;
            form.verify({
                username: function (v) {
                    if (v.trim() == '') {
                        return "用户名不能为空";
                    }
                },
                password: function (v) {
                    if (v.trim() == '') {
                        return "密码不能为空";
                    }
                },
                code: function (v) {
                    if (v.trim() == '') {
                        return '验证码不能为空';
                    }
                },
                check: function (v, a, b) {
                    if (!$(a).prop("checked")) {
                        return '请选择 同意《注册协议》 和 《隐私政策》';
                    }
                }
            });
            var msg = '${message}';
            if (msg.trim() != "") {
                layer.msg(msg, {icon: 5, anim: 6, offset: 't'});
                setTimeout(function(){
                    location.href="${re.contextPath}/login";
                },800);
            }
            $("#code").click(function () {
                var url = "${re.contextPath}/getCode?v=" + new Date().getTime();
                this.src = url;
            }).click().show();
            $('#code').on('mouseover', function () {
                layer.tips('点击刷新验证码', this, {time: 1000});
            });
            form.render();
        });

    })
    function xy(){
        window.location.href="/sys/register/regXy";
        var a=$("#username").val();
        var p=$("#password").val();
        document.cookie=a+","+p;
    }
    function ys(){
        window.location.href="/sys/register/regYs";
        var a=$("#username").val();
        var p=$("#password").val();
        document.cookie=a+","+p;
    }

    function toRegister() {
        var _agx = $("#cl_gxbox .focus").attr("lay-ay");
        var _agz = $("#cl_gzbox .focus").attr("lay-ay");
        var _alx = '';
        $("#cl_lxbox [type=checkbox]:checked").each(function (i, v) {
            var _a = $(v).val();
            if (_alx) {
                _alx = _alx + "," + _a;
            } else {
                _alx = _a;
            }
        });
        console.log(_alx)
        if (_agx == "002" && _agz == "001") {
            layer.msg("需方请选择组织");
            return;
        }
        if (_alx == 0) {
            layer.msg("请选择业务类型!");
            return;
        }
        window.location.href = "/sys/register/goRegister?_agx=" + _agx + "&_agz=" + _agz + "&_alx=" + _alx;
    }

    function forget() {
        var username = $('#username').val();
        window.location.href = "/sys/register/forgets?username="+username;
    }

    if (window != top) {
        top.location.href = location.href;
    }

</script>


<!-- 底部结束 -->
</body>
<style>

      .center-div {
       position: fixed;
       bottom: 50px;
       left: 50%;
       transform: translateX(-50%);
       width: 500px; /* 可以根据需要调整宽度 */
       height: 100px; /* 可以根据需要调整高度 */
       text-align: center;
          color: red;
          background-color: #f5f5f5;
       line-height: 100px; /* 使文本垂直居中，与高度一致 */
   }
         .footer {
       position: fixed;
       bottom: 0;
       left: 0;
       width: 100%;
       text-align: center;
       padding: 10px 0; /* 可以根据需要调整内边距 */
       background-color: #F8FAF8; /* 背景颜色，可以根据需要调整 */
       box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1); /* 可选：添加阴影效果 */
   }
</style>
</html>
